home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
asm
/
demos
/
sinescroll_3
/
sinescroller.s
< prev
next >
Wrap
Text File
|
1980-01-03
|
4KB
|
225 lines
section sinescroll,code_c
incdir 'src:Exsyslib/'
include 'include/hardware/custom.i' ;define customchips
include 'include/hardware/exsys_takeover.s' ;1st codeline!
*-------------- Install a new copperlist..
lea copperlist(pc),a0
bsr.s newcopper
lea bpl,a0
move.l #plane,d0
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
main cmp.b #100,$dff006
bne.s main
bsr putchar_left
bsr blit_scroll
btst #6,$bfe001 ; check the left mouse button
bne.s main
rts
newcopper: lea $dff000,a6 ;a6=custom hardware
move.w #$7fff,$96(a6) ;no dma
move.l a0,$80(a6) ;install new copperlist ptr
move.w d0,$88(a6) ;strobe copper
move.w #$83c0,$96(a6) ;enable copper dma
rts
delay: dc.w 8
timer: dc.w 0
putchar_left: tst.w timer
beq goon
subq.w #1,timer
rts
goon: bsr blitwait
*-------------- blit scroll bitmap to the left
move.l #plane,$0054(a6)
move.l #plane+2,$0050(a6)
move.l #$e9f00000,$0040(a6)
move.l #$ffffffff,$0044(a6)
clr.l $0064(a6)
move.w #$0555,$0058(a6)
bsr blitwait
move.w delay(pc),d0
subq.w #1,d0
beq.s textout
move.w d0,delay
rts
textout: move.w #8,delay
move.l textpointer(pc),a0
moveq #0,d0
move.b (a0)+,d0
cmp.b #1,(a0)
bne.s lsd_suck
move.w #200,timer
move.w #$20,d0
addq.l #1,a0
lsd_suck: tst.b (a0)
bne.s no_restart
lea text(pc),a0
no_restart: move.l a0,textpointer
lbc34: cmp.b #$49,d0
bne.s lbc42
move.w #5,delay
lbc42: sub.b #$20,d0
divu #$14,d0
move.w d0,d1
clr.w d0
swap d0
mulu #$348,d1
lsl.w #1,d0
lea font,a0 ;font
add.l d0,a0
add.l d1,a0
lea plane+42,a1 ;pos
move.l (a0),(a1)
move.l 40*01(a0),44*01(a1)
move.l 40*02(a0),44*02(a1)
move.l 40*03(a0),44*03(a1)
move.l 40*04(a0),44*04(a1)
move.l 40*05(a0),44*05(a1)
move.l 40*06(a0),44*06(a1)
move.l 40*07(a0),44*07(a1)
move.l 40*08(a0),44*08(a1)
move.l 40*09(a0),44*09(a1)
move.l 40*10(a0),44*10(a1)
move.l 40*11(a0),44*11(a1)
move.l 40*12(a0),44*12(a1)
move.l 40*13(a0),44*13(a1)
move.l 40*14(a0),44*14(a1)
move.l 40*15(a0),44*15(a1)
move.l 40*16(a0),44*16(a1)
move.l 40*17(a0),44*17(a1)
move.l 40*18(a0),44*18(a1)
move.l 40*19(a0),44*19(a1)
rts
blit_scroll:
lea plane+$1000,a1
not.b flag * swap buffer
beq.s other
lea $2000(a1),a1
other move.l a1,d6 * show current buffer
lea bpl,a0 *
move.w d6,6(a0)
swap d6
move.w d6,2(a0)
swap d6
*-------------- blit erase playfield..
bsr blitwait
move.l d6,$0054(a6)
subq.l #2,d6
move.w #$0100,$0040(a6)
move.w #2,$0066(a6)
move.w #$2b94+256,$0058(a6)
bsr blitwait
*-------------- blit sine scroll..
move.w #$0dfc,$0040(a6)
move.w #$0028,$0066(a6)
move.l #$0028002a,$0062(a6)
move.w #$8400,$0096(a6) * blit nasty on..
move.l #plane,d2
move.l sinpointer(pc),a2
move.l #sintab+960,d7
move.w #$0501,d1
moveq #(40/2)-1,d3
sine_lines: move.w #$8000,d0
moveq #16-1,d5
sine_words: moveq #0,d4
move.b (a2)+,d4
move.l d7,a0
add.w d4,a0
add.w d4,a0
move.w (a0),d4
add.w d4,d6
move.l d6,$4c(a6)
move.l d2,$50(a6)
move.l d6,$54(a6)
sub.l d4,d6
move.w d0,$46(a6)
move.w d1,$58(a6)
bsr.s blitwait
ror.w #1,d0
dbra d5,sine_words
addq.l #2,d2
addq.l #2,d6
dbra d3,sine_lines
move.w #$0400,$0096(a6) * blit nasy off
cmp.l #sintab,sinpointer ;sintab
ble.s next_pos
subq.l #1,sinpointer
rts
next_pos: add.l #319,sinpointer
rts
blitwait: btst #14,2(a6)
bne.s blitwait
rts
textpointer: dc.l text
sinpointer: dc.l sintab+$13f
flag: dc.w 0
text: dc.b " SINE# SCROLLER! ",01," @ MR SINE OF MOST USED EFFECTS INC !!!",0
even
copperlist: dc.w $008e,$2c81,$0090,$2cc1
dc.w $0092,$0038,$0094,$00d0
dc.w $0100,$0200,$0102,$0045
dc.w $0108,$0002,$010a,$0002
dc.w $0180,$0005,$0182,$000f
dc.w $01fc,$0000,$0106,$0000
dc.w $2001,$fffe,$0100,$1200
bpl dc.w $e0
dc.w 0,$e2
dc.w 0,$e4
dc.w 0,$e6
dc.w 0
dc.w $e001,$fffe,$0108,-82,$010a,-82
dc.w $0182,$00ff
dc.l -2
sintab: incbin 'src:sinescroller/sin.bin'
font incbin 'src:sinescroller/fonta'
plane ds.b $10000